<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="/WEB-INF/sitemesh-decorator.tld" prefix="decorator"%>

<!DOCTYPE html>
<!--[if IE 8]> <html class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html class="no-js"> <!--<![endif]-->
<head>
   <meta charset="utf-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <link rel="shortcut icon" href="<s:url value="/favicon.ico"/>" />
   <title>物流管理系统 · <decorator:title /> </title>
   
   <decorator:usePage id="decoratedPage" />
	<% 
		String navUri = decoratedPage.getProperty("meta.navUri");
		request.setAttribute("navUri", navUri);
	%>
	
   <!-- BEGIN GLOBAL MANDATORY STYLES --> 
   <link href="<s:url value='/admin/assets/plugins/font-awesome/css/font-awesome.min.css'/>" rel="stylesheet" type="text/css"/>
   <link rel="stylesheet" type="text/css" href="<s:url value='/admin/assets/plugins/bootstrap-fileupload/bootstrap-fileupload.css' />" />
   <link href="<s:url value='/admin/assets/plugins/bootstrap/css/bootstrap.min.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/plugins/uniform/css/uniform.default.css' />" rel="stylesheet" type="text/css"/>
   <!-- END GLOBAL MANDATORY STYLES -->
   
   <link href="<s:url value='/admin/assets/plugins/gritter/css/jquery.gritter.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css' />" rel="stylesheet" type="text/css" />
   <link href="<s:url value='/admin/assets/plugins/fullcalendar/fullcalendar/fullcalendar.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/plugins/jqvmap/jqvmap/jqvmap.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.css' />" rel="stylesheet" type="text/css"/>
   
   <!-- BEGIN THEME STYLES --> 
   <link href="<s:url value='/admin/assets/css/style-conquer.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/css/style.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/css/style-responsive.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/css/plugins.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/css/pages/tasks.css' />" rel="stylesheet" type="text/css"/>
   <link href="<s:url value='/admin/assets/css/themes/default.css' />" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="<s:url value='/admin/assets/css/custom.css' />" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   
   <!-- BEGIN PAGE LEVEL STYLES --> 
   <link href="<s:url value='/admin/assets/plugins/select2/select2_conquer.css' />" rel="stylesheet" type="text/css" />
   <!-- END PAGE LEVEL SCRIPTS -->
   
   
   <link href="<s:url value='/admin/assets/plugins/data-tables/DT_bootstrap.css' />" rel="stylesheet" type="text/css" />
   <link href="<s:url value='/admin/assets/plugins/jquery-file-upload/css/jquery.fileupload-ui.css' />" rel="stylesheet" type="text/css" />
   
   <link href="<s:url value='/admin/assets/plugins/bootstrap-switch/static/stylesheets/bootstrap-switch-conquer.css' />" rel="stylesheet" type="text/css" >
   
   <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <!-- BEGIN CORE PLUGINS -->   
   <!--[if lt IE 9]>
   <script src="<s:url value='/admin/assets/plugins/respond.min.js' />"></script>
   <script src="<s:url value='/admin/assets/plugins/excanvas.min.js' />"></script> 
   <![endif]-->   
  
	<script src="<s:url value='/admin/assets/plugins/jquery-1.10.2.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-migrate-1.2.1.min.js' />" type="text/javascript"></script>   
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="<s:url value='/admin/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/bootstrap/js/bootstrap.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/bootstrap-fileupload/bootstrap-fileupload.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js' />" type="text/javascript" ></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery.blockui.min.js' />" type="text/javascript"></script>  
	<script src="<s:url value='/admin/assets/plugins/jquery.cookie.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/uniform/jquery.uniform.min.js' />" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script src="<s:url value='/admin/assets/plugins/jquery.peity.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery.pulsate.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-knob/js/jquery.knob.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/flot/jquery.flot.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/flot/jquery.flot.resize.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/bootstrap-daterangepicker/moment.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/bootstrap-daterangepicker/daterangepicker.js' />" type="text/javascript"></script>     
	<script src="<s:url value='/admin/assets/plugins/gritter/js/jquery.gritter.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-validation/dist/jquery.validate.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-validation/dist/additional-methods.min.js' />" type="text/javascript"></script>
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="<s:url value='/admin/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/plugins/jquery.sparkline.min.js' />" type="text/javascript"></script>  
	<script src="<s:url value='/admin/assets/plugins/select2/select2.min.js' />"></script>
	<script src="<s:url value='/admin/assets/plugins/data-tables/jquery.dataTables.js' />"></script>
	<script src="<s:url value='/admin/assets/plugins/data-tables/DT_bootstrap.js' />"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="<s:url value='/admin/assets/scripts/app.js' />" type="text/javascript"></script>
	<script src="<s:url value='/admin/assets/scripts/index.js' />" type="text/javascript"></script>  
	<script src="<s:url value='/admin/assets/scripts/tasks.js' />" type="text/javascript"></script>  
	
	<script>
	   $(document).ready(function() {    
	      App.init(); // initlayout and core plugins
	   });
	   
	  var editorImageUpUrl = '<s:property value="getWebPath()"/>/admin/upload-image.shtml';
	  var ueditorImagePath = '<s:property value="config.ueditorImageHost"/>';
	  
	  var imageManagerUrl = '<s:property value="getWebPath()"/>/admin/manager-image.shtml';       //图片在线管理的处理地址
	  var ueditorImageManagerPath = '<s:property value="config.ueditorImageHost"/>';
	   
	</script>
	
   <!-- END PAGE LEVEL SCRIPTS -->  
   
	<script src="<s:url value='/admin/js/jquery_validator_defaults.js' />" type="text/javascript" ></script> 
	<script src="<s:url value='/admin/js/jquery_validator_messages_cn.js' />" type="text/javascript" ></script>
	<script src="<s:url value='/admin/js/ajax.js' />" type="text/javascript" ></script>
	
	<script language="javascript" type="text/javascript" src="<s:url value="/admin/js/My97DatePicker/WdatePicker.js" />"></script>
   	<script language="javascript" type="text/javascript" src="<s:url value="/admin/js/func.js" />"></script>
   
   <!--ueditor -->
	<script src="<s:url value="/ueditor/ueditor.all.js" />" type="text/javascript"></script>
	<script src="<s:url value="/ueditor/ueditor.config.js"/>"></script>
	<script src="<s:url value="/ueditor/lang/zh-cn/zh-cn.js"/>"></script>
	
	<script src="<s:url value="/admin/assets/plugins/bootstrap-switch/static/js/bootstrap-switch.min.js"/>" type="text/javascript"></script>  
  	
</head>
<s:set id="cityList" name="cityList" value="cityList" />
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->   
   <div class="header navbar navbar-inverse navbar-fixed-top">
      <!-- BEGIN TOP NAVIGATION BAR -->
      <div class="header-inner">
         <!-- BEGIN LOGO -->  
         <a class="navbar-brand" href="<s:url action='index' namespace='/admin' />">
         <img src="<s:url value='/admin/assets/img/logo.png' />" alt="logo" class="img-responsive" />
         </a>
         <!-- END LOGO -->
         <ul class="nav navbar-nav pull-right">
            <li class="devider">&nbsp;</li>
            <!-- BEGIN USER LOGIN DROPDOWN -->
            <li class="dropdown user">
               <a href="index.html#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
               <span class="username"><s:property value="logonUser.username"/></span>
               <i class="icon-angle-down"></i>
               </a>
               <ul class="dropdown-menu">
                  <li id="changePasswordLi"><a href="#"><i class="icon-user"></i> 修改密码</a>
                  </li>
                  <li><a href="<s:url action="logout" namespace="/admin" />"><i class="icon-key"></i> 退出</a></li>
               </ul>
            </li>
         </ul>
      </div>
      <!-- END TOP NAVIGATION BAR -->
   </div>
   <!-- END HEADER -->
   
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
   	<div class="page-sidebar navbar-collapse collapse">
         <!-- BEGIN SIDEBAR MENU -->        
         <s:include value="admin-nav.jsp" />
         <!-- END SIDEBAR MENU -->
      </div>
      
      
     <div class="page-content">
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN PAGE TITLE & BREADCRUMB-->
               <h3 class="page-title">
                  <span><decorator:title /></span>
                  <div id="titleActionBar" style="float: right"></div>
               </h3>
            </div>
         </div>
     	
     	<div class="row">
     		<decorator:body />
     	</div>
     </div>
   </div>
<!--    <input type="button" value="桌面提醒显示时间" onClick="fnShow();">   -->
  <script>
  $(document).ready(function() {
	  //setInterval("getNeedPickup()", 15000);
			   
  });
  var icon = '<s:url value="/admin/assets/img/avatar.png"/>' ;
  function getNeedPickup() {
	  ajaxPost('<s:url action="needPickup" namespace="/admin/pickup" />', null,
			function(response){
				var pickups = response.recordset;
				if (pickups.length == 0) {
					return;
				}
				
				if (browser_support_notification()) {
					$.each(pickups, function(index, pickup){
						
			            var title = "有新一条需上门取件信息:" + pickup.name;
			            var body = "电话:" + pickup.phone + "地址:" + pickup.address;
			 
			            if (window.webkitNotifications) {
			                if (window.webkitNotifications.checkPermission() == 0) {
			                    var popup = window.webkitNotifications.createNotification(icon, title, body);
			                    popup.ondisplay = function(event) {
			                        setTimeout(function() {
			                            event.currentTarget.cancel();
			                        }, 5000);
			                    }
			                    popup.show();
			                } else {
			                    window.webkitNotifications.requestPermission();
			                    return;
			                }
			            }
					});
				} else {
					var title = "有新"+pickups.length+"条需上门取件信息";
		            var body = "查看详细信息:请到上门信息中查看";
					Notification.requestPermission(function (perm) {   
		                if (perm == "granted") {   
		                    var notification = new Notification(title, {   
		                        dir: "auto",   
		                        lang: "hi",   
		                        tag: "testTag",   
		                        icon: icon,   
		                        body: body,
		                        url:"<s:url action='list' namespace='/admin/template' />"
		                    });   
		                }   
		            });
				}
			}
		);
  }
  
 
   function browser_support_notification(){
          return window.webkitNotifications;
   }
  
   function fnShow() {   
       var date = new Date();   
       var time = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();   
       Notification.requestPermission(function (perm) {   
           if (perm == "granted") {   
               var notification = new Notification("现在时间:", {   
                   dir: "auto",   
                   lang: "hi",   
                   tag: "testTag",   
                   icon: "http://www.html5party.com/bbs/static/image/common/logo.png",   
                   body: time   
               });   
           }   
       });   
   }   
  </script> 
   <div class="footer">
      <div class="footer-inner">
      </div>
   </div>
   <s:include value="change-pwd.jsp" />
</body>